<%@page import="com.wanmait.hotelManagement.vo.Pager"%>
<%@page import="com.wanmait.hotelManagement.vo.RoomType"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%String path = request.getContextPath(); %>
<!DOCTYPE html>
<!-- 包含的头和尾已写 -->
<!-- 网页由RoomServlet转发 -->
<html lang="en">
<head>
<meta charset="utf-8">
<title>Explore Rooms</title>
<!-- Stylesheets -->
<link href="<%=path%>/hotel/css/bootstrap.css" rel="stylesheet">
<link href="<%=path%>/hotel/css/style.css" rel="stylesheet">
<!-- Responsive File -->
<link href="<%=path%>/hotel/css/responsive.css" rel="stylesheet">

<link rel="shortcut icon" href="<%=path%>/hotel/images/favicon.png" type="image/x-icon">
<link rel="icon" href="<%=path%>/hotel/images/favicon.png" type="image/x-icon">

<!-- Responsive Settings -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<!--[if lt IE 9]><script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.js"></script><![endif]-->
<!--[if lt IE 9]><script src="<%=path%>/hotel/js/respond.js"></script><![endif]-->
<!-- 分页页数css -->
<style type="text/css">
	.shuZi{
		width: 100px;
		margin: auto;
		text-align: center;
	}
</style>
</head>

<body>

<div class="page-wrapper">
    <!-- Preloader -->
    <div class="preloader"><div class="icon"></div></div>

    <!-- Main Header -->
    <header class="main-header header-style-one">

        <!-- Header Upper -->
         <jsp:include page="/hotel/include/head.jsp"></jsp:include>
        <!--End Header Upper-->

        <!-- Mobile Menu  -->
        <div class="mobile-menu">
            <div class="close-btn"><span class="icon flaticon-targeting-cross"></span></div>
            <div class="menu-backdrop"></div>
            <div class="nav-logo"><a href="index.html"><img src="<%=path%>/hotel/images/nav-logo.png" alt="" title=""></a></div>
            <nav class="menu-box">
                <div class="menu-outer"><!--Here Menu Will Come Automatically Via Javascript / Same Menu as in Header--></div>
            </nav>
            <div class="nav-bottom">
                <div class="copyright">Hotera  &copy;  2020 All Right Reserved</div>
                <!--Social Links-->
                <div class="social-links">
                    <ul class="clearfix">
                        <li><a href="#"><span class="fab fa-facebook-f"></span></a></li>
                        <li><a href="#"><span class="fab fa-twitter"></span></a></li>
                        <li><a href="#"><span class="fab fa-vimeo-v"></span></a></li>
                    </ul>
                </div>
            </div>
        </div><!-- End Mobile Menu -->

    </header>
    <!-- End Main Header -->


    <!-- Banner Section -->
    <section class="page-banner">
        <div class="image-layer" style="background-image:url(<%=path%>/hotel/images/background/banner-image-2.jpg);"></div>
        <div class="banner-bottom-pattern"></div>

        <div class="banner-inner">
            <div class="auto-container">
                <div class="inner-container clearfix">
                    <h1>客房和套房</h1>
                    <div class="page-nav">
                        <ul class="bread-crumb clearfix">
                            <li><a href="<%=path%>/IndexServlet">首页</a></li>
                            <li class="active">房间列表</li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <!--End Banner Section -->

    <!--Rooms Section-->
    <section class="rooms-section rooms-list">
        <div class="auto-container">
            <!--Filters Section-->
           <!--  <div class="filters-section filters-container">
                <div class="form-box default-form filter-form wow fadeInUp" data-wow-delay="0ms" data-wow-duration="1500ms">
                    <form method="post" action="room-single.html">
                        <div class="row clearfix">
                            <div class="form-group col-xl-3 col-lg-6 col-md-6 col-sm-12">
                                <div class="field-label">Stay</div>
                                <div class="field-inner">
                                    <input id="arrival-date" class="date-picker" type="text" name="field-name" value="Nov 02. 2019" placeholder="">
                                    <label for="arrival-date" class="icon flaticon-down-arrow"></label>
                                </div>
                            </div>
                            <div class="form-group col-xl-3 col-lg-6 col-md-6 col-sm-12">
                                <div class="field-label">Room type</div>
                                <div class="field-inner">
                                    <select class="custom-select-box">
                                        <option>Balcony Room</option>
                                        <option>Deluxe Room</option>
                                        <option>Superior Room</option>
                                        <option>Luxury Room</option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group col-xl-3 col-lg-6 col-md-6 col-sm-12">
                                <div class="field-label">Guests</div>
                                <div class="field-inner">
                                    <div class="check-sel-box">
                                        <div class="check-sel-btn">
                                            <span class="adult-info">2 Adults.</span>
                                            <span class="child-info">1 Children</span>
                                        </div>
                                        <ul class="check-sel-droplist">
                                            <li>
                                                <div class="sel-title">Select Adults:</div>
                                                <div class="clearfix">
                                                    <div class="radio-block adult-block"><input type="radio" name="adult-group" id="radio-1" value="1 Adults."><label for="radio-1">1</label></div>
                                                    <div class="radio-block adult-block"><input type="radio" name="adult-group" id="radio-2" value="2 Adults." checked=""><label for="radio-2">2</label></div>
                                                    <div class="radio-block adult-block"><input type="radio" name="adult-group" id="radio-3" value="3 Adults."><label for="radio-3">3</label></div>
                                                    <div class="radio-block adult-block"><input type="radio" name="adult-group" id="radio-4" value="4 Adults."><label for="radio-4">4</label></div>
                                                </div>
                                            </li>
                                            <li>
                                                <div class="sel-title">Select Children:</div>
                                                <div class="clearfix">
                                                    <div class="radio-block child-block"><input type="radio" name="child-group" id="radio-5" value="1 Children" checked=""><label for="radio-5">1</label></div>
                                                    <div class="radio-block child-block"><input type="radio" name="child-group" id="radio-6" value="2 Children"><label for="radio-6">2</label></div>
                                                    <div class="radio-block child-block"><input type="radio" name="child-group" id="radio-7" value="3 Children"><label for="radio-7">3</label></div>
                                                    <div class="radio-block child-block"><input type="radio" name="child-group" id="radio-8" value="4 Children"><label for="radio-8">4</label></div>
                                                </div>
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group col-xl-3 col-lg-6 col-md-6 col-sm-12">
                                <div class="field-label e-label">&nbsp;</div>
                                <div class="field-inner">
                                    <button class="theme-btn btn-style-one"><span class="btn-title">Start  Filter</span></button>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </div> -->
            <div class="rooms-box">
            <%List<RoomType> allRoomType = (List<RoomType>)request.getAttribute("allRoomType"); 
            for(RoomType roomType:allRoomType)
            {%>
            	<!--Room-->
                <div class="room-block-four wow fadeInUp" data-wow-delay="0ms" data-wow-duration="1500ms">
                    <div class="inner-box">
                        <div class="image-box">
                            <figure class="image"><img src="<%=path%>/hotel/images/room/<%=roomType.getPictures().get(0).getImages()%>" alt="" title=""></figure>
                            <div class="image-layer" style="background-image: url(<%=path%>/hotel/images/room/<%=roomType.getPictures().get(0).getImages()%>;"></div>
                            <a class="overlink" href="<%=path %>/RoomServlet?action=singleRoom&typeId=<%=roomType.getId()%>"></a>
                        </div>
                        <div class="content-box">
                            <!-- <div class="rating">
                            
                                <span class="fa fa-star"></span>
                                <span class="fa fa-star"></span>
                                <span class="fa fa-star"></span>
                                <span class="fa fa-star"></span>
                                <span class="fa fa-star"></span>
                            </div> -->
                            <h4><%=roomType.getRoomName() %></h4>
                            <div class="text"><%=roomType.getRemarks() %></div>
                            <div class="link-row clearfix">
                                <div class="pricing clearfix">
                                    <div class="price">From <span>￥<%=roomType.getRoomPrice() %></span></div>
                                </div>
                                <div class="link-box"><a href="<%=path %>/RoomServlet?action=singleRoom&typeId=<%=roomType.getId()%>" class="theme-btn btn-style-one"><span class="btn-title">Book Now</span></a></div>
                            </div>
                        </div>
                    </div>
                </div>
            <%}
            %>
                <!--Room-->
                <%-- <div class="room-block-four wow fadeInUp" data-wow-delay="0ms" data-wow-duration="1500ms">
                    <div class="inner-box">
                        <div class="image-box">
                            <figure class="image"><img src="<%=path%>/hotel/images/resource/featured-image-30.jpg" alt="" title=""></figure>
                            <div class="image-layer" style="background-image: url(<%=path%>/hotel/images/resource/featured-image-30.jpg);"></div>
                            <a class="overlink" href="roomSingle.jsp"></a>
                        </div>
                        <div class="content-box">
                            <div class="rating">
                                <span class="fa fa-star"></span>
                                <span class="fa fa-star"></span>
                                <span class="fa fa-star"></span>
                                <span class="fa fa-star"></span>
                                <span class="fa fa-star"></span>
                            </div>
                            <h4>Balcony Room</h4>
                            <div class="text">Excepteur sint ocaecat cupidatat dent in sun in culpa qui officia deserunt mollit anim estlabor sed ut perspiciatis unde omnis iste natus error sit voluptatem acusantium doloremque laudan totam rem aperiam eaque ipsa quae.</div>
                            <div class="link-row clearfix">
                                <div class="pricing clearfix">
                                    <div class="price">From <span>$50.00</span></div>
                                </div>
                                <div class="link-box"><a href="roomSingle.jsp" class="theme-btn btn-style-one"><span class="btn-title">Book Now</span></a></div>
                            </div>
                        </div>
                    </div>
                </div>

                <!--Room-->
                <div class="room-block-four wow fadeInUp" data-wow-delay="0ms" data-wow-duration="1500ms">
                    <div class="inner-box">
                        <div class="image-box">
                            <figure class="image"><img src="<%=path%>/hotel/images/resource/featured-image-31.jpg" alt="" title=""></figure>
                            <div class="image-layer" style="background-image: url(<%=path%>/hotel/images/resource/featured-image-31.jpg);"></div>
                            <a class="overlink" href="roomSingle.jsp"></a>
                        </div>
                        <div class="content-box">
                            <div class="rating">
                                <span class="fa fa-star"></span>
                                <span class="fa fa-star"></span>
                                <span class="fa fa-star"></span>
                                <span class="fa fa-star"></span>
                                <span class="fa fa-star"></span>
                            </div>
                            <h4>Deluxe Room</h4>
                            <div class="text">Excepteur sint ocaecat cupidatat dent in sun in culpa qui officia deserunt mollit anim estlabor sed ut perspiciatis unde omnis iste natus error sit voluptatem acusantium doloremque laudan totam rem aperiam eaque ipsa quae.</div>
                            <div class="link-row clearfix">
                                <div class="pricing clearfix">
                                    <div class="price">From <span>$50.00</span></div>
                                </div>
                                <div class="link-box"><a href="roomSingle.jsp" class="theme-btn btn-style-one"><span class="btn-title">Book Now</span></a></div>
                            </div>
                        </div>
                    </div>
                </div>

                <!--Room-->
                <div class="room-block-four wow fadeInUp" data-wow-delay="0ms" data-wow-duration="1500ms">
                    <div class="inner-box">
                        <div class="image-box">
                            <figure class="image"><img src="<%=path%>/hotel/images/resource/featured-image-32.jpg" alt="" title=""></figure>
                            <div class="image-layer" style="background-image: url(<%=path%>/hotel/images/resource/featured-image-32.jpg);"></div>
                            <a class="overlink" href="roomSingle.jsp"></a>
                        </div>
                        <div class="content-box">
                            <div class="rating">
                                <span class="fa fa-star"></span>
                                <span class="fa fa-star"></span>
                                <span class="fa fa-star"></span>
                                <span class="fa fa-star"></span>
                                <span class="fa fa-star"></span>
                            </div>
                            <h4>Luxury Room</h4>
                            <div class="text">Excepteur sint ocaecat cupidatat dent in sun in culpa qui officia deserunt mollit anim estlabor sed ut perspiciatis unde omnis iste natus error sit voluptatem acusantium doloremque laudan totam rem aperiam eaque ipsa quae.</div>
                            <div class="link-row clearfix">
                                <div class="pricing clearfix">
                                    <div class="price">From <span>$50.00</span></div>
                                </div>
                                <div class="link-box"><a href="roomSingle.jsp" class="theme-btn btn-style-one"><span class="btn-title">Book Now</span></a></div>
                            </div>
                        </div>
                    </div>
                </div>

                <!--Room-->
                <div class="room-block-four wow fadeInUp" data-wow-delay="0ms" data-wow-duration="1500ms">
                    <div class="inner-box">
                        <div class="image-box">
                            <figure class="image"><img src="<%=path%>/hotel/images/resource/featured-image-33.jpg" alt="" title=""></figure>
                            <div class="image-layer" style="background-image: url(<%=path%>/hotel/images/resource/featured-image-33.jpg);"></div>
                            <a class="overlink" href="roomSingle.jsp"></a>
                        </div>
                        <div class="content-box">
                            <div class="rating">
                                <span class="fa fa-star"></span>
                                <span class="fa fa-star"></span>
                                <span class="fa fa-star"></span>
                                <span class="fa fa-star"></span>
                                <span class="fa fa-star"></span>
                            </div>
                            <h4>Sea View Room</h4>
                            <div class="text">Excepteur sint ocaecat cupidatat dent in sun in culpa qui officia deserunt mollit anim estlabor sed ut perspiciatis unde omnis iste natus error sit voluptatem acusantium doloremque laudan totam rem aperiam eaque ipsa quae.</div>
                            <div class="link-row clearfix">
                                <div class="pricing clearfix">
                                    <div class="price">From <span>$50.00</span></div>
                                </div>
                                <div class="link-box"><a href="roomSingle.jsp" class="theme-btn btn-style-one"><span class="btn-title">Book Now</span></a></div>
                            </div>
                        </div>
                    </div>
                </div>

                <!--Room-->
                <div class="room-block-four wow fadeInUp" data-wow-delay="0ms" data-wow-duration="1500ms">
                    <div class="inner-box">
                        <div class="image-box">
                            <figure class="image"><img src="<%=path%>/hotel/images/resource/featured-image-34.jpg" alt="" title=""></figure>
                            <div class="image-layer" style="background-image: url(<%=path%>/hotel/images/resource/featured-image-34.jpg);"></div>
                            <a class="overlink" href="roomSingle.jsp"></a>
                        </div>
                        <div class="content-box">
                            <div class="rating">
                                <span class="fa fa-star"></span>
                                <span class="fa fa-star"></span>
                                <span class="fa fa-star"></span>
                                <span class="fa fa-star"></span>
                                <span class="fa fa-star"></span>
                            </div>
                            <h4>Superior Room</h4>
                            <div class="text">Excepteur sint ocaecat cupidatat dent in sun in culpa qui officia deserunt mollit anim estlabor sed ut perspiciatis unde omnis iste natus error sit voluptatem acusantium doloremque laudan totam rem aperiam eaque ipsa quae.</div>
                            <div class="link-row clearfix">
                                <div class="pricing clearfix">
                                    <div class="price">From <span>$50.00</span></div>
                                </div>
                                <div class="link-box"><a href="roomSingle.jsp" class="theme-btn btn-style-one"><span class="btn-title">Book Now</span></a></div>
                            </div>
                        </div>
                    </div>
                </div> --%>
            </div>
            <!-- 分页数字开始 -->
            <div class="shuZi">
            	<%Pager pager = (Pager)request.getAttribute("pager");
            	for(int i=1; i<=pager.getPageCount(); i++)
            	{%>
            		<a class="no" href="javascript:void(0);"><%=i%></a>
            	<%}
            	%>
            </div>
            <!-- 分页数字结束 -->
            <!-- 给分页数字添加点击事件 -->
            <script type="text/javascript">
            	$(function(){
            		$(".no").click(function(){
            			var num = $(this).html();
            			$.ajax({
            				url:"<%=path%>/RoomServlet",
            				type:"post",
            				data:{action:"getAllRoomType",pageNo:num},
            				success:function(mes){
            					$(".rooms-box").html(mes);
            				}
            			});
            		});
            	});
            </script>
            <!-- 事件结束 -->
        </div>
    </section>

    <!-- Main Footer -->
    <jsp:include page="/hotel/include/footer.jsp"></jsp:include>
</div>
<!--End pagewrapper--><!--Scroll to top--><div class="scroll-to-top scroll-to-target" data-target="html"><span class="flaticon-up-arrow"></span></div>

<script src="<%=path%>/hotel/js/jquery.js"></script>
<script src="<%=path%>/hotel/js/popper.min.js"></script>
<script src="<%=path%>/hotel/js/bootstrap.min.js"></script>
<script src="<%=path%>/hotel/js/jquery-ui.js"></script>
<script src="<%=path%>/hotel/js/jquery.fancybox.js"></script>
<script src="<%=path%>/hotel/js/owl.js"></script>
<script src="<%=path%>/hotel/js/scrollbar.js"></script>
<script src="<%=path%>/hotel/js/appear.js"></script>
<script src="<%=path%>/hotel/js/wow.js"></script>
<script src="<%=path%>/hotel/js/custom-script.js"></script>

</body>
</html>